"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[1828],{73224:(e,o,t)=>{t.d(o,{Z:()=>r});var n=t(69307),i=t(70444);const r=(0,n.createElement)(i.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(i.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}))},1574:(e,o,t)=>{t.r(o),t.d(o,{CoreProfilerController:()=>Ce,coreProfilerStateMachineDefinition:()=>fe,default:()=>he,preFetchActions:()=>ke});var n=t(69307),i=t(5031),r=t(47090),a=t(11122),l=t(55954),s=t(28226),c=t(50883),M=t(9818),u=t(10431),g=t(67221),N=t(73516),p=t(74617),m=t(1718),I=t(65736),d=t(55609),D=t(75283),j=t(86020),T=t(83849),y=t.n(T);const E=e=>{let{className:o,title:t,subTitle:i}=e;return(0,n.createElement)("div",{className:y()("woocommerce-profiler-heading",o)},(0,n.createElement)("h1",{className:"woocommerce-profiler-heading__title"},t),i&&(0,n.createElement)("h2",{className:"woocommerce-profiler-heading__subtitle"},i))},z=()=>(0,n.createElement)("svg",{preserveAspectRatio:"xMidYMid",version:"1.1",viewBox:"0 0 256 153",xmlns:"http://www.w3.org/2000/svg",className:"wc-icon wc-icon__woo-logo"},(0,n.createElement)("path",{d:"m23.759 0h208.38c13.187 0 23.863 10.675 23.863 23.863v79.542c0 13.187-10.675 23.863-23.863 23.863h-74.727l10.257 25.118-45.109-25.118h-98.695c-13.187 0-23.863-10.675-23.863-23.863v-79.542c-0.10466-13.083 10.571-23.863 23.758-23.863z",fill:"#7f54b3"}),(0,n.createElement)("path",{d:"m14.578 21.75c1.4569-1.9772 3.6423-3.0179 6.5561-3.226 5.3073-0.41626 8.3252 2.0813 9.0537 7.4927 3.226 21.75 6.7642 40.169 10.511 55.259l22.79-43.395c2.0813-3.9545 4.6829-6.0358 7.8049-6.2439 4.5789-0.3122 7.3886 2.6016 8.5333 8.7415 2.6016 13.841 5.9317 25.6 9.8862 35.59 2.7057-26.433 7.2846-45.476 13.737-57.236 1.561-2.9138 3.8504-4.3707 6.8683-4.5789 2.3935-0.20813 4.5789 0.52033 6.5561 2.0813 1.9772 1.561 3.0179 3.5382 3.226 5.9317 0.10406 1.8732-0.20813 3.4341-1.0407 4.9951-4.0585 7.4927-7.3886 20.085-10.094 37.567-2.6016 16.963-3.5382 30.179-2.9138 39.649 0.20813 2.6016-0.20813 4.8911-1.2488 6.8683-1.2488 2.2894-3.122 3.5382-5.5154 3.7463-2.7057 0.20813-5.5154-1.0406-8.2211-3.8504-9.678-9.8862-17.379-24.663-22.998-44.332-6.7642 13.32-11.759 23.311-14.985 29.971-6.1398 11.759-11.343 17.795-15.714 18.107-2.8098 0.20813-5.2033-2.1854-7.2846-7.1805-5.3073-13.633-11.031-39.961-17.171-78.985-0.41626-2.7057 0.20813-5.0992 1.665-6.9724zm223.64 16.338c-3.7463-6.5561-9.2618-10.511-16.65-12.072-1.9772-0.41626-3.8504-0.62439-5.6195-0.62439-9.9902 0-18.107 5.2033-24.455 15.61-5.4114 8.8455-8.1171 18.628-8.1171 29.346 0 8.013 1.665 14.881 4.9951 20.605 3.7463 6.5561 9.2618 10.511 16.65 12.072 1.9772 0.41626 3.8504 0.62439 5.6195 0.62439 10.094 0 18.211-5.2033 24.455-15.61 5.4114-8.9496 8.1171-18.732 8.1171-29.45 0.10406-8.1171-1.665-14.881-4.9951-20.501zm-13.112 28.826c-1.4569 6.8683-4.0585 11.967-7.9089 15.402-3.0179 2.7057-5.8276 3.8504-8.4293 3.3301-2.4976-0.52033-4.5789-2.7057-6.1398-6.7642-1.2488-3.226-1.8732-6.452-1.8732-9.4699 0-2.6016 0.20813-5.2033 0.72846-7.5967 0.93659-4.2667 2.7057-8.4293 5.5154-12.384 3.4341-5.0992 7.0764-7.1805 10.823-6.452 2.4976 0.52033 4.5789 2.7057 6.1398 6.7642 1.2488 3.226 1.8732 6.452 1.8732 9.4699 0 2.7057-0.20813 5.3073-0.72846 7.7008zm-52.033-28.826c-3.7463-6.5561-9.3659-10.511-16.65-12.072-1.9772-0.41626-3.8504-0.62439-5.6195-0.62439-9.9902 0-18.107 5.2033-24.455 15.61-5.4114 8.8455-8.1171 18.628-8.1171 29.346 0 8.013 1.665 14.881 4.9951 20.605 3.7463 6.5561 9.2618 10.511 16.65 12.072 1.9772 0.41626 3.8504 0.62439 5.6195 0.62439 10.094 0 18.211-5.2033 24.455-15.61 5.4114-8.9496 8.1171-18.732 8.1171-29.45 0-8.1171-1.665-14.881-4.9951-20.501zm-13.216 28.826c-1.4569 6.8683-4.0585 11.967-7.9089 15.402-3.0179 2.7057-5.8276 3.8504-8.4293 3.3301-2.4976-0.52033-4.5789-2.7057-6.1398-6.7642-1.2488-3.226-1.8732-6.452-1.8732-9.4699 0-2.6016 0.20813-5.2033 0.72846-7.5967 0.93658-4.2667 2.7057-8.4293 5.5154-12.384 3.4341-5.0992 7.0764-7.1805 10.823-6.452 2.4976 0.52033 4.5789 2.7057 6.1398 6.7642 1.2488 3.226 1.8732 6.452 1.8732 9.4699 0.10406 2.7057-0.20813 5.3073-0.72846 7.7008z",fill:"#fff"})),O=e=>{let{className:o="",percent:t=0,color:i="#674399",bgcolor:r="var(--wp-admin-theme-color)"}=e;const a={backgroundColor:r},l={backgroundColor:i,width:`${t}%`,display:0===t?"none":"inherit"};return(0,n.createElement)("div",{className:`woocommerce-profiler-progress-bar ${o}`},(0,n.createElement)("div",{className:"woocommerce-profiler-progress-bar__container",style:a},(0,n.createElement)("div",{className:"woocommerce-profiler-progress-bar__filler",style:l})))},S=e=>{let{percentage:o=0,onSkip:t,skipText:i=(0,I.__)("Skip this step","woocommerce"),showProgress:r=!0,showLogo:a=!0,classNames:l={},progressBarColor:s="var(--wp-admin-theme-color)"}=e;return(0,n.createElement)("div",{className:y()("woocommerce-profiler-navigation-container",l)},r&&(0,n.createElement)(O,{className:"progress-bar",percent:o,color:s,bgcolor:"transparent"}),(0,n.createElement)("div",{className:"woocommerce-profiler-navigation"},(0,n.createElement)("div",{className:"woocommerce-profiler-navigation-col-left"},a&&(0,n.createElement)("span",{className:"woologo"},(0,n.createElement)(z,null))),(0,n.createElement)("div",{className:"woocommerce-profiler-navigation-col-right"},"function"==typeof t&&(0,n.createElement)(d.Button,{onClick:t,className:y()("woocommerce-profiler-navigation-skip-link",l.mobile?"mobile":""),isLink:!0},i))))};var _=t(23374),w=t(73224);const A=e=>{let{className:o,selected:t,title:i,name:r,value:a,onChange:l,subOptionsComponent:s=null}=e;const c=()=>{l(a)},M="woocommerce-"+a.replace(/_/g,"-");return(0,n.createElement)("div",{role:"radio",className:y()("woocommerce-profiler-choice-container",o),onClick:c,onKeyDown:e=>{"Enter"===e.key&&c()},"data-selected":t||null,tabIndex:0},(0,n.createElement)("div",{className:"woocommerce-profiler-choice"},(0,n.createElement)("input",{className:"woocommerce-profiler-choice-input",id:M,name:r,type:"radio",value:a,checked:!!t,onChange:c,"data-selected":t||null,tabIndex:-1}),(0,n.createElement)("label",{htmlFor:M,className:"choice__title"},i)),t&&s&&(0,n.createElement)("div",{className:"woocommerce-profiler-choice-sub-options"},s))},k=e=>{let{options:o,onSelect:t,selectedOptions:i=[],placeholder:r=(0,I.__)("Select platforms","woocommerce"),onOpenClose:a=(()=>{})}=e;return(0,n.createElement)(j.__experimentalSelectControl,{label:"",multiple:!0,__experimentalOpenMenuOnFocus:!0,readOnlyWhenClosed:!1,items:o,getFilteredItems:e=>e,selected:i,inputProps:{"aria-readonly":!0,"aria-label":(0,I.__)("Use up and down arrow keys to navigate","woocommerce")},onKeyDown:e=>{if(e.key.length<=1)return e.preventDefault(),!1},placeholder:i.length?"":r,stateReducer:(e,o)=>{const{changes:t,type:n}=o;switch(n){case j.selectControlStateChangeTypes.ControlledPropUpdatedSelectedItem:return{...t,inputValue:e.inputValue};case j.selectControlStateChangeTypes.ItemClick:return{...t,isOpen:!0,inputValue:e.inputValue,highlightedIndex:e.highlightedIndex};case j.selectControlStateChangeTypes.InputBlur:return e.isOpen&&o.selectItem?{...t,isOpen:!0}:t;default:return t}},onSelect:e=>{if(!e)return;const o=i.find((o=>o.value===e.value))?i.filter((o=>o.value!==e.value)):[...i,e];t(o)},onRemove:e=>t(i.filter((o=>o!==e)))},(e=>{let{selectedOptions:o,onOpenClose:t}=e;return e=>{let{items:i,highlightedIndex:r,isOpen:a,getItemProps:l,getMenuProps:s}=e;return(0,n.useEffect)((()=>{t(a)}),[a]),(0,n.createElement)(j.__experimentalSelectControlMenu,{isOpen:a,getMenuProps:s,scrollIntoViewOnOpen:!0},i.map(((e,t)=>{const i=o.includes(e);return(0,n.createElement)(j.__experimentalSelectControlMenuItem,{key:`${e.value}`,index:t,item:e,getItemProps:l,isActive:r===t,activeStyle:{backgroundColor:"#f6f7f7"}},(0,n.createElement)(d.CheckboxControl,{className:y()("core-profiler__checkbox",{"is-selected":i}),onChange:()=>{},checked:i,label:e.label}))})))}})({selectedOptions:i,onOpenClose:a}))},L=[{title:(0,I.__)("I'm just starting my business","woocommerce"),value:"im_just_starting_my_business"},{title:(0,I.__)("I'm already selling","woocommerce"),value:"im_already_selling"},{title:(0,I.__)("I'm setting up a store for a client","woocommerce"),value:"im_setting_up_a_store_for_a_client"}],x=[{label:(0,I.__)("Yes, I'm selling online","woocommerce"),value:"yes_im_selling_online",key:"yes_im_selling_online"},{label:(0,I.__)("No, I'm selling offline","woocommerce"),value:"no_im_selling_offline",key:"no_im_selling_offline"},{label:(0,I.__)("I'm selling both online and offline","woocommerce"),value:"im_selling_both_online_and_offline",key:"im_selling_both_online_and_offline"}],f=[{label:(0,I.__)("Amazon","woocommerce"),value:"amazon"},{label:(0,I.__)("Adobe Commerce","woocommerce"),value:"adobe_commerce"},{label:(0,I.__)("Big Cartel","woocommerce"),value:"big_cartel"},{label:(0,I.__)("Big Commerce","woocommerce"),value:"big_commerce"},{label:(0,I.__)("Ebay","woocommerce"),value:"ebay"},{label:(0,I.__)("Ecwid","woocommerce"),value:"ecwid"},{label:(0,I.__)("Etsy","woocommerce"),value:"etsy"},{label:(0,I.__)("Facebook Marketplace","woocommerce"),value:"facebook_marketplace"},{label:(0,I.__)("Google Shopping","woocommerce"),value:"google_shopping"},{label:(0,I.__)("Pinterest","woocommerce"),value:"pinterest"},{label:(0,I.__)("Shopify","woocommerce"),value:"shopify"},{label:(0,I.__)("Square","woocommerce"),value:"square"},{label:(0,I.__)("Squarespace","woocommerce"),value:"squarespace"},{label:(0,I.__)("Wix","woocommerce"),value:"wix"},{label:(0,I.__)("WordPress","woocommerce"),value:"wordpress"}];var C=t(32162),h=t(22629);const v=[void 0,"woocommerce","Site Title",""],Q=[{label:(0,I.__)("Clothing and accessories","woocommerce"),key:"clothing_and_accessories"},{label:(0,I.__)("Health and beauty","woocommerce"),key:"health_and_beauty"},{label:(0,I.__)("Food and drink","woocommerce"),key:"food_and_drink"},{label:(0,I.__)("Home, furniture and garden","woocommerce"),key:"home_furniture_and_garden"},{label:(0,I.__)("Education and learning","woocommerce"),key:"education_and_learning"},{label:(0,I.__)("Electronics and computers","woocommerce"),key:"electronics_and_computers"},{label:(0,I.__)("Other","woocommerce"),key:"other"}],U={im_just_starting_my_business:(0,I.__)("What type of products or services do you plan to sell?","woocommerce"),im_already_selling:(0,I.__)("Which industry is your business in?","woocommerce"),im_setting_up_a_store_for_a_client:(0,I.__)("Which industry is your client's business in?","woocommerce")};var b=t(38811),P=t(62621),Y=t(60784),G=t(77),R=t(24122);const B={title:(0,I.__)("Turning on the lights","woocommerce"),image:(0,n.createElement)("img",{src:b,alt:"loader-lightbulb"}),paragraphs:[{label:(0,I.__)("#FunWooFact: ","woocommerce"),text:(0,I.__)("The Woo team is made up of over 350 talented individuals, distributed across 30+ countries.","woocommerce")}]},W={title:(0,I.__)("Extending your store's capabilities","woocommerce"),image:(0,n.createElement)("img",{src:Y,alt:"loader-lightbulb"}),paragraphs:[{label:(0,I.__)("#FunWooFact: ","woocommerce"),text:(0,I.__)("Did you know that Woo powers almost 4 million stores worldwide? You’re in good company.","woocommerce")}]},F={title:(0,I.__)("Woo! Let's get your features ready","woocommerce"),image:(0,n.createElement)("img",{src:P,alt:"loader-developng"}),paragraphs:[{label:(0,I.__)("#FunWooFact: ","woocommerce"),text:(0,I.__)("Did you know that Woo was founded by two South Africans and a Norwegian? Here are three alternative ways to say “store” in those countries – Winkel, ivenkile, and butikk.","woocommerce")}]},Z={title:(0,I.__)("Opening the doors","woocommerce"),image:(0,n.createElement)("img",{src:G,alt:"loader-opening-the-doors"}),paragraphs:[{label:(0,I.__)("#FunWooFact: ","woocommerce"),text:(0,I.__)("Our favorite color is purple ","woocommerce"),element:(0,n.createElement)("img",{src:R,alt:"loader-hearticon",className:"loader-hearticon"})}]},V=e=>{var o,t,i,r,a,l;let{context:s}=e;const c=(e=>{switch(e){case"plugins":return[F,W,B];case"skippedGuidedSetup":return[B,Z];default:return[B]}})(null!==(o=s.loader.useStages)&&void 0!==o?o:"default")[null!==(t=s.loader.stageIndex)&&void 0!==t?t:0],[M,u]=(0,n.useState)(0);return(0,n.useEffect)((()=>{var e,o;const t=setInterval((()=>{u((e=>c.paragraphs[e+1]?e+1:0))}),null!==(e=null===(o=c.paragraphs[M])||void 0===o?void 0:o.duration)&&void 0!==e?e:3e3);return()=>clearInterval(t)}),[M,c.paragraphs]),(0,n.createElement)("div",{className:y()("woocommerce-profiler-loader",s.loader.className)},(0,n.createElement)("div",{className:"woocommerce-profiler-loader-wrapper"},c.image&&c.image,(0,n.createElement)("h1",{className:"woocommerce-profiler-loader__title"},c.title),(0,n.createElement)(O,{className:"progress-bar",percent:null!==(i=s.loader.progress)&&void 0!==i?i:0,color:"var(--wp-admin-theme-color)",bgcolor:"#E0E0E0"}),(0,n.createElement)("p",{className:"woocommerce-profiler-loader__paragraph"},(0,n.createElement)("b",null,null===(r=c.paragraphs[M])||void 0===r?void 0:r.label," "),null===(a=c.paragraphs[M])||void 0===a?void 0:a.text,null===(l=c.paragraphs[M])||void 0===l?void 0:l.element)))};var J=t(99196),H=t(32008);const X=e=>{let{installed:o=!1,icon:t,title:i,onChange:r,checked:a=!1,description:l,learnMoreLink:s}=e;return(0,n.createElement)("div",{className:"woocommerce-profiler-plugins-plugin-card"},(0,n.createElement)("div",{className:"woocommerce-profiler-plugin-card-top"},!o&&(0,n.createElement)(d.CheckboxControl,{className:"core-profiler__checkbox",checked:a,onChange:r||(()=>{})}),t,(0,n.createElement)("div",{className:y()("woocommerce-profiler-plugins-plugin-card-text-header",{installed:o})},(0,n.createElement)("h3",null,i),o&&(0,n.createElement)("span",null,(0,I.__)("Installed","woocommerce")))),(0,n.createElement)("div",{className:y()("woocommerce-profiler-plugins-plugin-card-text",{"smaller-margin-left":o})},(0,n.createElement)("p",{dangerouslySetInnerHTML:(0,H.ZP)(l)}),s))};var K;const q=((null===(K=(0,t(73463).O3)("locale"))||void 0===K?void 0:K.siteLocale)||"en_US").replace("_","-"),$=e=>new Intl.ListFormat(q,{style:"long",type:"conjunction"}).formatToParts(e);var ee=t(34374);const{pure:oe}=l,te=(0,a.C)({id:"plugin-installer",predictableActionArguments:!0,initial:"installing",context:{selectedPlugins:[],pluginsAvailable:[],pluginsInstallationQueue:[],installedPlugins:[],startTime:0,installationDuration:0,errors:[]},states:{installing:{initial:"installer",entry:["populateDefaults","assignPluginsInstallationQueue","assignStartTime"],after:{INSTALLATION_TIMEOUT:"timedOut"},states:{installer:{initial:"installing",states:{installing:{invoke:{src:"installPlugin",onDone:{actions:["assignInstallationSuccessDetails"],target:"removeFromQueue"},onError:{actions:"assignInstallationErrorDetails",target:"removeFromQueue"}}},removeFromQueue:{entry:["removePluginFromQueue","updateParentWithPluginProgress"],always:[{target:"installing",cond:"hasPluginsToInstall"},{target:"#installation-finished"}]}}}}},finished:{id:"installation-finished",entry:["assignInstallationDuration"],always:[{target:"reportErrors",cond:"hasErrors"},{target:"reportSuccess"}]},timedOut:{entry:["assignInstallationDuration"],invoke:{src:"queueRemainingPluginsAsync",onDone:{target:"reportSuccess"}}},reportErrors:{entry:"updateParentWithInstallationErrors"},reportSuccess:{entry:"updateParentWithInstallationSuccess"}}},{delays:{INSTALLATION_TIMEOUT:3e4},actions:{populateDefaults:(0,i.f0)({installedPlugins:[],errors:[],startTime:0,installationDuration:0}),assignPluginsInstallationQueue:(0,i.f0)({pluginsInstallationQueue:e=>e.selectedPlugins.slice().sort(((o,t)=>{var n,i;const r=e.pluginsAvailable.find((e=>e.key===o)),a=e.pluginsAvailable.find((e=>e.key===t));return(null!==(n=null==r?void 0:r.install_priority)&&void 0!==n?n:99)-(null!==(i=null==a?void 0:a.install_priority)&&void 0!==i?i:99)}))}),assignStartTime:(0,i.f0)({startTime:()=>window.performance.now()}),assignInstallationDuration:(0,i.f0)({installationDuration:e=>window.performance.now()-e.startTime}),assignInstallationSuccessDetails:(0,i.f0)({installedPlugins:(e,o)=>{const t=e.pluginsInstallationQueue[0];return[...e.installedPlugins,{plugin:t,installTime:o.data.data.install_time[t]||0}]}}),assignInstallationErrorDetails:(0,i.f0)({errors:(e,o)=>[...e.errors,{plugin:e.pluginsInstallationQueue[0],error:o.data.data.message}]}),removePluginFromQueue:(0,i.f0)({pluginsInstallationQueue:e=>e.pluginsInstallationQueue.slice(1)}),updateParentWithPluginProgress:oe((e=>(0,i.lj)({type:"PLUGIN_INSTALLED_AND_ACTIVATED",payload:{pluginsCount:e.selectedPlugins.length,installedPluginIndex:e.selectedPlugins.length-e.pluginsInstallationQueue.length}}))),updateParentWithInstallationErrors:(0,i.lj)((e=>({type:"PLUGINS_INSTALLATION_COMPLETED_WITH_ERRORS",payload:{errors:e.errors}}))),updateParentWithInstallationSuccess:(0,i.lj)((e=>({type:"PLUGINS_INSTALLATION_COMPLETED",payload:{installationCompletedResult:{installedPlugins:e.installedPlugins,totalTime:e.installationDuration}}})))},guards:{hasErrors:e=>e.errors.length>0,hasPluginsToInstall:e=>e.pluginsInstallationQueue.length>0},services:{installPlugin:e=>(0,M.dispatch)(g.PLUGINS_STORE_NAME).installAndActivatePlugins([e.pluginsInstallationQueue[0]]),queueRemainingPluginsAsync:e=>(0,M.dispatch)(g.ONBOARDING_STORE_NAME).installAndActivatePluginsAsync(e.pluginsInstallationQueue)}}),ne=()=>(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"woocommerce-profile-wizard__spinner","data-testid":"core-profiler-loading-screen"},(0,n.createElement)(d.Spinner,null)));var ie=t(14599);const re={recordTracksStepViewed:(e,o,t)=>{let{action:n}=t;const{step:i}=n;(0,ie.recordEvent)("coreprofiler_step_view",{step:i,wc_version:(0,p.getSetting)("wcVersion")})},recordTracksStepSkipped:(e,o,t)=>{let{action:n}=t;const{step:i}=n;(0,ie.recordEvent)(`coreprofiler_${i}_skip`)},recordTracksIntroCompleted:()=>{(0,ie.recordEvent)("coreprofiler_step_complete",{step:"intro_opt_in",wc_version:(0,p.getSetting)("wcVersion")})},recordTracksUserProfileCompleted:(e,o)=>{(0,ie.recordEvent)("coreprofiler_step_complete",{step:"user_profile",wc_version:(0,p.getSetting)("wcVersion")}),(0,ie.recordEvent)("coreprofiler_user_profile",{business_choice:o.payload.userProfile.businessChoice,selling_online_answer:o.payload.userProfile.sellingOnlineAnswer,selling_platforms:o.payload.userProfile.sellingPlatforms?o.payload.userProfile.sellingPlatforms.join():null})},recordTracksSkipBusinessLocationCompleted:()=>{(0,ie.recordEvent)("coreprofiler_step_complete",{step:"skip_business_location",wc_version:(0,p.getSetting)("wcVersion")})},recordTracksBusinessInfoCompleted:(e,o)=>{(0,ie.recordEvent)("coreprofiler_step_complete",{step:"business_info",wc_version:(0,p.getSetting)("wcVersion")}),(0,ie.recordEvent)("coreprofiler_business_info",{business_name_filled:-1===v.findIndex((e=>e===o.payload.storeName)),industry:o.payload.industry,store_location_previously_set:e.onboardingProfile.is_store_country_set||!1,geolocation_success:void 0!==e.geolocatedLocation,geolocation_overruled:o.payload.geolocationOverruled})},recordTracksPluginsLearnMoreLinkClicked:(e,o,t)=>{let{action:n}=t;const{step:i}=n;(0,ie.recordEvent)(`coreprofiler_${i}_learn_more_link_clicked`,{plugin:o.payload.plugin,link:o.payload.learnMoreLink})},recordFailedPluginInstallations:(e,o)=>{(0,ie.recordEvent)("coreprofiler_store_extensions_installed_and_activated",{success:!1,failed_extensions:o.payload.errors.map((e=>(0,ee.br)(e.plugin)))})},recordSuccessfulPluginInstallation:(e,o)=>{const t=o.payload.installationCompletedResult,n={success:!0,installed_extensions:t.installedPlugins.map((e=>(0,ee.br)(e.plugin))),total_time:(0,ee.Jm)(t.totalTime)};for(const e of t.installedPlugins)n["install_time_"+(0,ee.br)(e.plugin)]=(0,ee.Jm)(e.installTime);(0,ie.recordEvent)("coreprofiler_store_extensions_installed_and_activated",n)},recordTracksPluginsInstallationRequest:(e,o)=>{(0,ie.recordEvent)("coreprofiler_store_extensions_continue",{shown:o.payload.pluginsShown||[],selected:o.payload.pluginsSelected||[],unselected:o.payload.pluginsUnselected||[]})}},ae=(0,i.f0)({optInDataSharing:(e,o)=>"no"!==o.data}),le=(0,i.f0)({businessInfo:(e,o)=>({...e.businessInfo,storeName:v.includes(o.data)?void 0:o.data})}),se=(0,i.f0)({businessInfo:(e,o)=>({...e.businessInfo,location:o.data})}),ce=(0,i.f0)({spawnGetCountriesRef:()=>(0,r.Cs)((()=>(0,M.resolveSelect)(g.COUNTRIES_STORE_NAME).getCountries()),"core-profiler-prefetch-countries")}),Me=(0,i.f0)({spawnPrefetchOptionsRef:(e,o,t)=>{let{action:n}=t;(0,r.Cs)((()=>Promise.all([n.options.map((e=>(0,M.resolveSelect)(g.OPTIONS_STORE_NAME).getOption(e)))])),"core-profiler-prefetch-options")}}),ue=(0,i.f0)({countries:(e,o)=>o.data.reduce(((e,o)=>{if(!o.states.length)return e.push({key:o.code,label:(0,h.decodeEntities)(o.name)}),e;const t=o.states.map((e=>({key:o.code+":"+e.code,label:(0,h.decodeEntities)(o.name)+" — "+(0,h.decodeEntities)(e.name)})));return e.push(...t),e}),[])}),ge=(0,i.f0)({userProfile:(e,o)=>{if(!o.data)return{};const{business_choice:t,selling_online_answer:n,selling_platforms:i,...r}=o.data;return{...r,businessChoice:t,sellingOnlineAnswer:n,sellingPlatforms:i}}}),Ne=(0,i.f0)({onboardingProfile:(e,o)=>o.data}),pe=async e=>{if(e.optInDataSharing)return(0,M.resolveSelect)(g.COUNTRIES_STORE_NAME).geolocate()},me=(0,i.f0)({spawnGeolocationRef:e=>(0,r.Cs)((()=>pe(e)),"core-profiler-prefetch-geolocation")}),Ie=(0,i.f0)({geolocatedLocation:(e,o)=>o.data}),de=(0,i.f0)({spawnUpdateOnboardingProfileOptionRef:e=>(0,r.Cs)((()=>(e=>{const{businessChoice:o,sellingOnlineAnswer:t,sellingPlatforms:n}=e.userProfile;return(0,M.dispatch)(g.OPTIONS_STORE_NAME).updateOptions({woocommerce_onboarding_profile:{...e.onboardingProfile,business_choice:o,selling_online_answer:t,selling_platforms:n}})})(e)),"update-onboarding-profile")}),De=(0,i.f0)({businessInfo:(e,o)=>({...e.businessInfo,location:o.payload.storeLocation})}),je=(0,i.f0)({userProfile:(e,o)=>o.payload.userProfile}),Te=async(e,o)=>{const t=await(0,M.resolveSelect)(g.OPTIONS_STORE_NAME).getOption("woocommerce_onboarding_profile");return(0,M.dispatch)(g.OPTIONS_STORE_NAME).updateOptions({blogname:o.payload.storeName,woocommerce_default_country:o.payload.storeLocation,woocommerce_onboarding_profile:{...t,is_store_country_set:!0,industry:[o.payload.industry]}})},ye=(0,i.f0)({persistBusinessInfoRef:(e,o)=>(0,r.Cs)((()=>Te(0,o)),"core-profiler-update-business-info")}),Ee=e=>new Promise((o=>{setTimeout(o,e)})),ze=(0,i.f0)({optInDataSharing:(e,o)=>o.payload.optInDataSharing}),Oe=(0,i.f0)({isJetpackConnectedRef:()=>(0,r.Cs)((()=>(0,M.resolveSelect)(g.PLUGINS_STORE_NAME).isJetpackConnected()),"core-profiler-prefetch-is-jetpack-connected")}),Se=(0,i.f0)({jetpackAuthUrlRef:()=>(0,r.Cs)((()=>(0,M.resolveSelect)(g.ONBOARDING_STORE_NAME).getJetpackAuthUrl({redirectUrl:(0,p.getAdminLink)("admin.php?page=wc-admin"),from:"woocommerce-core-profiler"})),"core-profiler-prefetch-jetpack-auth-url")}),_e=(0,i.f0)({extensionsRef:()=>(0,r.Cs)((()=>(0,M.resolveSelect)(g.ONBOARDING_STORE_NAME).getFreeExtensions()),"core-profiler-prefetch-extensions")}),we=(0,i.f0)({pluginsAvailable:(e,o)=>o.data}),Ae=(0,i.f0)({pluginsSelected:(e,o)=>o.payload.pluginsSelected.map(ee.V7)}),ke={preFetchGetPlugins:_e,preFetchGetCountries:ce,preFetchGeolocation:me,preFetchOptions:Me,preFetchIsJetpackConnected:Oe,preFetchJetpackAuthUrl:Se},Le={...ke,...re,handlePlugins:we,updateQueryStep:(e,o,t)=>{let{action:n}=t;const{step:i}=(0,u.getQuery)();n.step!==i&&(0,u.updateQueryString)({step:n.step})},handleTrackingOption:ae,handleGeolocation:Ie,handleStoreNameOption:le,handleStoreCountryOption:se,assignOptInDataSharing:ze,assignStoreLocation:De,assignPluginsSelected:Ae,assignUserProfile:je,handleCountries:ue,handleOnboardingProfileOption:ge,assignOnboardingProfile:Ne,persistBusinessInfo:ye,spawnUpdateOnboardingProfileOption:de,redirectToWooHome:()=>{window.location.href=(0,u.getNewPath)({},"/",{})},redirectToJetpackAuthPage:(e,o)=>{const t=new URL(o.data.url);t.searchParams.set("installed_ext_success","1");const n=e.pluginsSelected.find((e=>"jetpack"===e||"jetpack-boost"===e));if(n){const e="jetpack"===n?"jetpack-ai":"jetpack-boost";t.searchParams.set("plugin_name",e)}window.location.href=t.toString()}},xe={getAllowTrackingOption:async()=>(0,M.resolveSelect)(g.OPTIONS_STORE_NAME).getOption("woocommerce_allow_tracking"),getStoreNameOption:async()=>(0,M.resolveSelect)(g.OPTIONS_STORE_NAME).getOption("blogname"),getStoreCountryOption:async()=>(0,M.resolveSelect)(g.OPTIONS_STORE_NAME).getOption("woocommerce_default_country"),getCountries:async()=>(0,M.resolveSelect)(g.COUNTRIES_STORE_NAME).getCountries(),getGeolocation:pe,getOnboardingProfileOption:async()=>(0,M.resolveSelect)(g.OPTIONS_STORE_NAME).getOption("woocommerce_onboarding_profile"),getPlugins:async()=>{var e;return(0,M.dispatch)(g.ONBOARDING_STORE_NAME).invalidateResolution("getFreeExtensions"),(null===(e=(await(0,M.resolveSelect)(g.ONBOARDING_STORE_NAME).getFreeExtensions()).find((e=>"obw/core-profiler"===e.key)))||void 0===e?void 0:e.plugins)||[]},browserPopstateHandler:()=>e=>{const o=()=>{e("EXTERNAL_URL_UPDATE")};return window.addEventListener("popstate",o),()=>{window.removeEventListener("popstate",o)}},updateBusinessInfo:Te,updateTrackingOption:async e=>{await new Promise((o=>{e.optInDataSharing&&"function"==typeof window.wcTracks.enable?window.wcTracks.enable((()=>{(0,N.initializeExPlat)(),o()})):(e.optInDataSharing||(window.wcTracks.isEnabled=!1),o())}));const o=e.optInDataSharing?"yes":"no";(0,M.dispatch)(g.OPTIONS_STORE_NAME).updateOptions({woocommerce_allow_tracking:o})}},fe=(0,a.C)({id:"coreProfiler",initial:"navigate",predictableActionArguments:!0,invoke:{src:"browserPopstateHandler"},on:{EXTERNAL_URL_UPDATE:{target:"navigate"}},context:{optInDataSharing:!1,userProfile:{skipped:!0},geolocatedLocation:void 0,businessInfo:{storeName:void 0,industry:void 0,storeCountryPreviouslySet:!1,location:"US:CA"},countries:[],pluginsAvailable:[],pluginsInstallationErrors:[],pluginsSelected:[],loader:{},onboardingProfile:{},jetpackAuthUrl:void 0},states:{navigate:{always:[{target:"#introOptIn",cond:{type:"hasStepInUrl",step:"intro-opt-in"}},{target:"#userProfile",cond:{type:"hasStepInUrl",step:"user-profile"}},{target:"#businessInfo",cond:{type:"hasStepInUrl",step:"business-info"}},{target:"#plugins",cond:{type:"hasStepInUrl",step:"plugins"}},{target:"#skipGuidedSetup",cond:{type:"hasStepInUrl",step:"skip-guided-setup"}},{target:"introOptIn"}]},introOptIn:{id:"introOptIn",initial:"preIntroOptIn",states:{preIntroOptIn:{entry:["preFetchGetPlugins","preFetchGetCountries",{type:"preFetchOptions",options:["blogname","woocommerce_onboarding_profile","woocommerce_default_country"]}],type:"parallel",states:{trackingOption:{initial:"fetching",states:{fetching:{invoke:{src:"getAllowTrackingOption",onDone:[{actions:["handleTrackingOption"],target:"done"}],onError:{target:"done"}}},done:{type:"final"}}}},onDone:{target:"introOptIn"},meta:{progress:0}},introOptIn:{on:{INTRO_COMPLETED:{target:"postIntroOptIn",actions:["assignOptInDataSharing"]},INTRO_SKIPPED:{target:"#skipGuidedSetup",actions:["assignOptInDataSharing","updateTrackingOption"]}},meta:{progress:20,component:e=>{let{sendEvent:o,navigationProgress:t}=e;const[i,r]=(0,n.useState)(!0);return(0,n.createElement)("div",{className:"woocommerce-profiler-intro-opt-in","data-testid":"core-profiler-intro-opt-in-screen"},(0,n.createElement)(S,{percentage:t,skipText:(0,I.__)("Skip guided setup","woocommerce"),onSkip:()=>o({type:"INTRO_SKIPPED",payload:{optInDataSharing:!1}})}),(0,n.createElement)("div",{className:"woocommerce-profiler-page__content woocommerce-profiler-intro-opt-in__content"},(0,n.createElement)("div",{className:"woocommerce-profiler-welcome-image"}),(0,n.createElement)(E,{title:(0,I.__)("Welcome to Woo!","woocommerce"),subTitle:(0,D.Z)({mixedString:(0,I.__)("It's great to have you here with us! We'll be guiding you through the setup process – first, answer a few questions to tailor your experience.","woocommerce"),components:{br:(0,n.createElement)("br",null)}})}),(0,n.createElement)(d.Button,{className:"woocommerce-profiler-setup-store__button",variant:"primary",onClick:()=>o({type:"INTRO_COMPLETED",payload:{optInDataSharing:i}})},(0,I.__)("Set up my store","woocommerce")),(0,n.createElement)("div",{className:"woocommerce-profiler-intro-opt-in__footer"},(0,n.createElement)(d.CheckboxControl,{className:"core-profiler__checkbox",label:(0,D.Z)({mixedString:(0,I.__)("I agree to share my data to tailor my store setup experience and get more relevant content (WooCommerce will never rent or sell your data, and you can opt out at any time in WooCommerce settings. {{link}}Learn more about usage tracking.{{/link}})","woocommerce"),components:{link:(0,n.createElement)(j.Link,{href:"https://woocommerce.com/usage-tracking?utm_medium=product",target:"_blank",type:"external"})}}),checked:i,onChange:r}))))}}},postIntroOptIn:{invoke:{src:"updateTrackingOption",onDone:{actions:["recordTracksIntroCompleted"],target:"#userProfile"}}}}},userProfile:{id:"userProfile",initial:"preUserProfile",states:{preUserProfile:{invoke:{src:"getOnboardingProfileOption",onDone:[{actions:["handleOnboardingProfileOption","assignOnboardingProfile"],target:"userProfile"}],onError:{target:"userProfile"}}},userProfile:{meta:{progress:40,component:e=>{let{sendEvent:o,navigationProgress:t,context:i}=e;const[r,a]=(0,n.useState)(i.userProfile.businessChoice||"im_just_starting_my_business"),[l,s]=(0,n.useState)(i.userProfile.sellingOnlineAnswer||null),[c,M]=(0,n.useState)(i.userProfile.sellingPlatforms||null),[u,g]=(0,n.useState)(!1);return(0,n.createElement)("div",{className:"woocommerce-profiler-user-profile","data-testid":"core-profiler-user-profile"},(0,n.createElement)(S,{percentage:t,skipText:(0,I.__)("Skip this step","woocommerce"),onSkip:()=>o({type:"USER_PROFILE_SKIPPED",payload:{userProfile:{skipped:!0}}})}),(0,n.createElement)("div",{className:y()("woocommerce-profiler-page__content woocommerce-profiler-user-profile__content",{"is-platform-selector-open":u})},(0,n.createElement)(E,{className:"woocommerce-profiler__stepper-heading",title:(0,I.__)("Which one of these best describes you?","woocommerce"),subTitle:(0,I.__)("Let us know where you are in your commerce journey so that we can tailor your Woo experience for you.","woocommerce")}),(0,n.createElement)("form",{className:"woocommerce-user-profile-choices"},(0,n.createElement)("fieldset",null,(0,n.createElement)("legend",{className:"screen-reader-text"},(0,I.__)("Which one of these best describes you?","woocommerce")),L.map((e=>{let{title:o,value:t}=e;return(0,n.createElement)(A,{key:t,name:"user-profile-choice",title:o,selected:r===t,value:t,onChange:e=>{a(e)},subOptionsComponent:"im_already_selling"===t?(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"woocommerce-profiler-selling-online-question"},(0,n.createElement)("p",{className:"woocommerce-profiler-question-label"},(0,I.__)("Are you selling online?","woocommerce")),(0,n.createElement)(j.SelectControl,{className:"woocommerce-profiler-select-control__selling-online-question",instanceId:1,label:(0,I.__)("Select an option","woocommerce"),autoComplete:"new-password",options:x,excludeSelectedOptions:!1,help:(0,n.createElement)(_.Z,{icon:w.Z}),onChange:e=>{s(e)},multiple:!1,selected:l})),l&&["yes_im_selling_online","im_selling_both_online_and_offline"].includes(l)&&(0,n.createElement)("div",{className:"woocommerce-profiler-selling-platform"},(0,n.createElement)("p",{className:"woocommerce-profiler-question-label"},(0,I.__)("Which platform(s) are you currently using?","woocommerce")),(0,n.createElement)(k,{options:f,selectedOptions:f.filter((e=>null==c?void 0:c.includes(e.value))),onSelect:e=>{M(e.map((e=>e.value)))},onOpenClose:g}))):null})})))),(0,n.createElement)("div",{className:"woocommerce-profiler-button-container"},(0,n.createElement)(d.Button,{className:"woocommerce-profiler-button",variant:"primary",onClick:()=>{o({type:"USER_PROFILE_COMPLETED",payload:{userProfile:{businessChoice:r,sellingOnlineAnswer:"im_already_selling"===r?l:null,sellingPlatforms:"im_already_selling"===r?c:null}}})}},(0,I.__)("Continue","woocommerce")))))}},entry:[{type:"recordTracksStepViewed",step:"user_profile"},{type:"updateQueryStep",step:"user-profile"},"preFetchGeolocation"],on:{USER_PROFILE_COMPLETED:{target:"postUserProfile",actions:["assignUserProfile"]},USER_PROFILE_SKIPPED:{target:"postUserProfile",actions:["assignUserProfile"]}},exit:l.choose([{cond:(e,o)=>"USER_PROFILE_COMPLETED"===o.type,actions:"recordTracksUserProfileCompleted"},{cond:(e,o)=>"USER_PROFILE_SKIPPED"===o.type,actions:[{type:"recordTracksStepSkipped",step:"user_profile"}]}])},postUserProfile:{entry:["spawnUpdateOnboardingProfileOption"],always:{target:"#businessInfo"}}}},businessInfo:{id:"businessInfo",initial:"preBusinessInfo",entry:[{type:"updateQueryStep",step:"business-info"}],states:{preBusinessInfo:{type:"parallel",states:{geolocation:{initial:"checkDataOptIn",states:{checkDataOptIn:{invoke:{src:"getAllowTrackingOption",onDone:[{actions:["handleTrackingOption"],target:"fetching"}],onError:{target:"done"}}},fetching:{invoke:{src:"getGeolocation",onDone:{target:"done",actions:"handleGeolocation"},onError:{target:"done"}}},done:{type:"final"}}},storeCountryOption:{initial:"fetching",states:{fetching:{invoke:{src:"getStoreCountryOption",onDone:[{actions:["handleStoreCountryOption"],target:"done"}],onError:{target:"done"}}},done:{type:"final"}}},onboardingProfileOption:{initial:"fetching",states:{fetching:{invoke:{src:"getOnboardingProfileOption",onDone:[{actions:["assignOnboardingProfile"],target:"done"}],onError:{target:"done"}}},done:{type:"final"}}},storeNameOption:{initial:"fetching",states:{fetching:{invoke:{src:"getStoreNameOption",onDone:[{actions:["handleStoreNameOption"],target:"done"}],onError:{target:"done"}}},done:{type:"final"}}},countries:{initial:"fetching",states:{fetching:{invoke:{src:"getCountries",onDone:{target:"done",actions:"handleCountries"}}},done:{type:"final"}}}},onDone:{target:"businessInfo"}},businessInfo:{meta:{progress:60,component:e=>{let{context:o,navigationProgress:t,sendEvent:i}=e;const{geolocatedLocation:r,userProfile:{businessChoice:a},businessInfo:l,countries:s,onboardingProfile:{is_store_country_set:c,industry:M,business_choice:u}}=o,[g,N]=(0,n.useState)(l.storeName||""),[p,m]=(0,n.useState)({key:"",label:""});(0,n.useEffect)((()=>{if(c){const e=s.find((e=>e.key===l.location));m(e||{key:"",label:""})}}),[l.location,s,c]);const[D,T]=(0,n.useState)({key:"",label:""});(0,n.useEffect)((()=>{if(r){const e=(0,C.findCountryOption)(s,r);e&&(T(e),c||m(e))}}),[s,c,r]);const y=r&&(0,C.getCountry)(p.key)!==(0,C.getCountry)(D.key),[z,O]=(0,n.useState)(M?Q.find((e=>e.key===M[0])):void 0),A=(0,I.__)("Select country/region","woocommerce"),k=U[a||u||"im_just_starting_my_business"],[L,x]=(0,n.useState)(!1),[f,v]=(0,n.useState)(!1);return(0,n.createElement)("div",{className:"woocommerce-profiler-business-information","data-testid":"core-profiler-business-information"},(0,n.createElement)(S,{percentage:t}),(0,n.createElement)("div",{className:"woocommerce-profiler-page__content woocommerce-profiler-business-information__content"},(0,n.createElement)(E,{className:"woocommerce-profiler__stepper-heading",title:(0,I.__)("Tell us a bit about your store","woocommerce"),subTitle:(0,I.__)("We'll use this information to help you set up payments, shipping, and taxes, as well as recommending the best theme for your store.","woocommerce")}),(0,n.createElement)("form",{className:"woocommerce-profiler-business-information-form",autoComplete:"off"},(0,n.createElement)(d.TextControl,{className:"woocommerce-profiler-business-info-store-name",onChange:e=>{N(e)},value:(0,h.decodeEntities)(g),label:(0,n.createElement)(n.Fragment,null,(0,I.__)("Give your store a name","woocommerce")),placeholder:(0,I.__)("Ex. My awesome store","woocommerce")}),(0,n.createElement)("p",{className:"woocommerce-profiler-question-subtext"},(0,I.__)("Don't worry — you can always change it later!","woocommerce")),(0,n.createElement)("p",{className:"woocommerce-profiler-question-label"},k),(0,n.createElement)(j.SelectControl,{className:"woocommerce-profiler-select-control__industry",instanceId:1,placeholder:(0,I.__)("Select an industry","woocommerce"),label:(0,I.__)("Select an industry","woocommerce"),options:Q,excludeSelectedOptions:!1,help:(0,n.createElement)(_.Z,{icon:w.Z}),onChange:e=>{e.length&&O(e[0])},selected:z?[z]:[],showAllOnFocus:!0,isSearchable:!0}),(0,n.createElement)("p",{className:"woocommerce-profiler-question-label"},(0,I.__)("Where is your store located?","woocommerce"),(0,n.createElement)("span",{className:"woocommerce-profiler-question-required"},"*")),(0,n.createElement)(j.SelectControl,{className:"woocommerce-profiler-select-control__country",instanceId:2,placeholder:A,label:""===p.key?A:"",getSearchExpression:e=>new RegExp("(^"+e+"| — ("+e+"))","i"),options:s,excludeSelectedOptions:!1,help:(0,n.createElement)(_.Z,{icon:w.Z}),onChange:e=>{e.length&&m(e[0])},selected:p?[p]:[],showAllOnFocus:!0,isSearchable:!0}),(0,n.createElement)("div",{className:"woocommerce-profiler-select-control__country-spacer"}),y&&!L&&(0,n.createElement)(d.Notice,{className:"woocommerce-profiler-geolocation-notice",onRemove:()=>x(!0),status:"warning"},(0,n.createElement)("p",null,(0,n.createInterpolateElement)((0,I.__)("It looks like you're located in <geolocatedCountry></geolocatedCountry>. Are you sure you want to create a store in <selectedCountry></selectedCountry>?","woocommerce"),{geolocatedCountry:(0,n.createElement)(d.Button,{className:"geolocation-notice-geolocated-country",variant:"link",onClick:()=>m(D)},null==r?void 0:r.country_long),selectedCountry:(0,n.createElement)("span",{className:"geolocation-notice-selected-country"},p.label)})),(0,n.createElement)("p",null,(0,I.__)("Setting up your store in the wrong country may lead to the following issues: ","woocommerce")),(0,n.createElement)("ul",{className:"woocommerce-profiler-geolocation-notice__list"},(0,n.createElement)("li",null,(0,I.__)("Tax and duty obligations","woocommerce")),(0,n.createElement)("li",null,(0,I.__)("Payment issues","woocommerce")),(0,n.createElement)("li",null,(0,I.__)("Shipping issues","woocommerce"))))),(0,n.createElement)("div",{className:"woocommerce-profiler-button-container"},(0,n.createElement)(d.Button,{className:"woocommerce-profiler-button",variant:"primary",disabled:!p.key,onClick:()=>{i({type:"BUSINESS_INFO_COMPLETED",payload:{storeName:g,industry:null==z?void 0:z.key,storeLocation:p.key,geolocationOverruled:y||!1}}),v(!0)}},f?(0,n.createElement)(d.Spinner,null):(0,I.__)("Continue","woocommerce")))))}},entry:[{type:"recordTracksStepViewed",step:"business_info"}],on:{BUSINESS_INFO_COMPLETED:{target:"postBusinessInfo",actions:["recordTracksBusinessInfoCompleted"]}}},postBusinessInfo:{invoke:{src:"updateBusinessInfo",onDone:{target:"#plugins"},onError:{target:"#plugins"}}}}},skipGuidedSetup:{id:"skipGuidedSetup",initial:"preSkipFlowBusinessLocation",entry:[{type:"updateQueryStep",step:"skip-guided-setup"}],states:{preSkipFlowBusinessLocation:{invoke:{src:"getCountries",onDone:[{actions:["handleCountries"],target:"skipFlowBusinessLocation"}],onError:{target:"skipFlowBusinessLocation"}}},skipFlowBusinessLocation:{on:{BUSINESS_LOCATION_COMPLETED:{target:"postSkipFlowBusinessLocation",actions:["assignStoreLocation","recordTracksSkipBusinessLocationCompleted"]}},entry:[{type:"recordTracksStepViewed",step:"skip_business_location"}],meta:{progress:80,component:e=>{let{sendEvent:o,navigationProgress:t,context:i}=e;const[r,a]=(0,n.useState)({key:"",label:""}),l=(0,I.__)("Select country/region","woocommerce");return(0,n.createElement)("div",{className:"woocommerce-profiler-business-location","data-testid":"core-profiler-business-location"},(0,n.createElement)(S,{percentage:t}),(0,n.createElement)("div",{className:"woocommerce-profiler-page__content woocommerce-profiler-business-location__content"},(0,n.createElement)(E,{className:"woocommerce-profiler__stepper-heading",title:(0,I.__)("Where is your business located?","woocommerce"),subTitle:(0,I.__)("We'll use this information to help you set up payments, shipping, and taxes.","woocommerce")}),(0,n.createElement)(j.SelectControl,{className:"woocommerce-profiler-select-control__country",instanceId:1,placeholder:l,label:""===r.key?l:"",getSearchExpression:e=>new RegExp("(^"+e+"| — ("+e+"))","i"),autoComplete:"new-password",options:i.countries,excludeSelectedOptions:!1,help:(0,n.createElement)(_.Z,{icon:w.Z}),onChange:e=>{e.length&&a(e[0])},selected:r?[r]:[],showAllOnFocus:!0,isSearchable:!0}),(0,n.createElement)("div",{className:"woocommerce-profiler-button-container woocommerce-profiler-go-to-mystore__button-container"},(0,n.createElement)(d.Button,{className:"woocommerce-profiler-button",variant:"primary",disabled:!r.key,onClick:()=>{o({type:"BUSINESS_LOCATION_COMPLETED",payload:{storeLocation:r.key}})}},(0,I.__)("Go to my store","woocommerce")))))}}},postSkipFlowBusinessLocation:{initial:"updateBusinessLocation",states:{updateBusinessLocation:{entry:(0,i.f0)({loader:{progress:10,useStages:"skippedGuidedSetup"}}),invoke:{src:e=>{const o=(0,M.dispatch)(g.ONBOARDING_STORE_NAME).updateProfileItems({skipped:!0}),t=(n=e.businessInfo.location,(0,M.dispatch)(g.OPTIONS_STORE_NAME).updateOptions({woocommerce_default_country:n}));var n;return Promise.all([o,t])},onDone:{target:"progress20"}}},progress20:{entry:(0,i.f0)({loader:{progress:20,useStages:"skippedGuidedSetup"}}),invoke:{src:()=>Ee(1500),onDone:{target:"progress80"}}},progress80:{entry:(0,i.f0)({loader:{progress:80,useStages:"skippedGuidedSetup",stageIndex:1}}),invoke:{src:()=>Ee(1500),onDone:{actions:["redirectToWooHome"]}}}},meta:{component:V}}}},plugins:{id:"plugins",initial:"prePlugins",states:{prePlugins:{invoke:{src:"getPlugins",onDone:[{target:"pluginsSkipped",cond:(e,o)=>{var t;return null===(t=o.data)||void 0===t?void 0:t.every((e=>e.is_activated))}},{target:"plugins",actions:"handlePlugins"}]},exit:(0,i.f0)({pluginsAvailable:e=>e.pluginsAvailable.filter((()=>!0))}),meta:{progress:70}},pluginsSkipped:{entry:(0,i.f0)({loader:{progress:80}}),invoke:{src:()=>((0,M.dispatch)(g.ONBOARDING_STORE_NAME).updateProfileItems({is_plugins_page_skipped:!0,completed:!0}),Ee(3e3)),onDone:[{target:"isJetpackConnected",cond:"hasJetpackSelected"},{actions:["redirectToWooHome"]}]},meta:{component:V}},plugins:{entry:[{type:"recordTracksStepViewed",step:"plugins"},{type:"updateQueryStep",step:"plugins"}],on:{PLUGINS_PAGE_SKIPPED:{actions:[{type:"recordTracksStepSkipped",step:"plugins"}],target:"pluginsSkipped"},PLUGINS_LEARN_MORE_LINK_CLICKED:{actions:[{type:"recordTracksPluginsLearnMoreLinkClicked",step:"plugins"}]},PLUGINS_INSTALLATION_REQUESTED:{target:"installPlugins",actions:["assignPluginsSelected","recordTracksPluginsInstallationRequest"]}},meta:{progress:80,component:e=>{let{context:o,navigationProgress:t,sendEvent:i}=e;const[r,a]=(0,J.useState)(o.pluginsAvailable.filter(o.pluginsInstallationErrors.length?e=>o.pluginsSelected.includes(e.key):e=>!e.is_activated)),l=()=>i({type:"PLUGINS_PAGE_SKIPPED"}),s=()=>{const e=r.map((e=>e.key.replace(":alt",""))),t=[],n=[];return o.pluginsAvailable.forEach((o=>{const i=o.key.replace(":alt","");t.push(i),o.is_activated||e.includes(i)||n.push(i)})),i({type:"PLUGINS_INSTALLATION_REQUESTED",payload:{pluginsShown:t,pluginsSelected:e,pluginsUnselected:n}})},c=e=>"element"===e.type?"{{span}}"+e.value+"{{/span}}":e.value,M=o.pluginsInstallationErrors.length?(0,D.Z)({mixedString:(0,I.sprintf)((0,I.__)("Oops! We encountered a problem while installing %s. {{link}}Please try again{{/link}}.","woocommerce"),$(o.pluginsInstallationErrors.map((e=>e.plugin))).map(c).join("")),components:{span:(0,n.createElement)("span",null),link:(0,n.createElement)(d.Button,{isLink:!0,onClick:s})}}):null,u=r.filter((e=>["jetpack","woocommerce-services:shipping","woocommerce-services:tax"].includes(e.key)));return(0,n.createElement)("div",{className:"woocommerce-profiler-plugins","data-testid":"core-profiler-plugins"},(0,n.createElement)(S,{percentage:t,onSkip:l}),(0,n.createElement)("div",{className:"woocommerce-profiler-page__content woocommerce-profiler-plugins__content"},(0,n.createElement)(E,{className:"woocommerce-profiler__stepper-heading",title:(0,I.__)("Get a boost with our free features","woocommerce"),subTitle:(0,I.__)("Enhance your store by installing these free business features. No commitment required – you can remove them at any time.","woocommerce")}),M&&(0,n.createElement)("p",{className:"plugin-error"},M),(0,n.createElement)("div",{className:"woocommerce-profiler-plugins__list"},o.pluginsAvailable.map((e=>{const o=e.learn_more_link?(0,n.createElement)(j.Link,{onClick:()=>{var o;i({type:"PLUGINS_LEARN_MORE_LINK_CLICKED",payload:{plugin:e.key,learnMoreLink:null!==(o=e.learn_more_link)&&void 0!==o?o:""}})},href:e.learn_more_link,target:"_blank",type:"external"},(0,I.__)("Learn More","woocommerce")):null;return(0,n.createElement)(X,{key:`checkbox-control-${e.key}`,installed:e.is_activated,onChange:()=>{(e=>{a(r.some((o=>o.key===e.key))?r.filter((o=>o.key!==e.key)):[...r,e])})(e)},checked:r.filter((o=>o.key===e.key)).length>0,icon:e.image_url?(0,n.createElement)("img",{src:e.image_url,alt:e.key}):null,title:e.label,description:e.description,learnMoreLink:o})}))),(0,n.createElement)("div",{className:"woocommerce-profiler-plugins-continue-button-container"},(0,n.createElement)(d.Button,{className:"woocommerce-profiler-plugins-continue-button",variant:"primary",onClick:r.length?s:l},(0,I.__)("Continue","woocommerce"))),u.length>0&&(0,n.createElement)("p",{className:"woocommerce-profiler-plugins-jetpack-agreement"},(0,D.Z)({mixedString:(0,I.sprintf)((0,I._n)("By installing %s plugin for free you agree to our {{link}}Terms of Service{{/link}}.","By installing %s plugins for free you agree to our {{link}}Terms of Service{{/link}}.",u.length,"woocommerce"),$(u.map((e=>e.name))).map(c).join("")),components:{span:(0,n.createElement)("span",null),link:(0,n.createElement)(j.Link,{href:"https://wordpress.com/tos/",target:"_blank",type:"external"})}}))))}}},postPluginInstallation:{invoke:{src:async(e,o)=>await(0,M.dispatch)(g.ONBOARDING_STORE_NAME).updateProfileItems({business_extensions:o.payload.installationCompletedResult.installedPlugins.map((e=>e.plugin)),completed:!0}),onDone:[{target:"isJetpackConnected",cond:"hasJetpackSelected"},{actions:"redirectToWooHome"}]},meta:{component:V,progress:100}},isJetpackConnected:{invoke:{src:async()=>await(0,M.resolveSelect)(g.PLUGINS_STORE_NAME).isJetpackConnected(),onDone:[{target:"sendToJetpackAuthPage",cond:(e,o)=>!o.data},{actions:"redirectToWooHome"}]},meta:{component:V,progress:100}},sendToJetpackAuthPage:{invoke:{src:async()=>await(0,M.resolveSelect)(g.ONBOARDING_STORE_NAME).getJetpackAuthUrl({redirectUrl:(0,p.getAdminLink)("admin.php?page=wc-admin"),from:"woocommerce-core-profiler"}),onDone:{actions:l.choose([{cond:(e,o)=>!0===o.data.success,actions:"redirectToJetpackAuthPage"},{cond:(e,o)=>!1===o.data.success,actions:"redirectToWooHome"}])}},meta:{component:V,progress:100}},installPlugins:{on:{PLUGIN_INSTALLED_AND_ACTIVATED:{actions:[(0,i.f0)({loader:(e,o)=>{const t=Math.round(o.payload.installedPluginIndex/o.payload.pluginsCount*100);let n=0;return t>60?n=2:t>30&&(n=1),{useStages:"plugins",progress:t,stageIndex:n}}})]},PLUGINS_INSTALLATION_COMPLETED_WITH_ERRORS:{target:"prePlugins",actions:[(0,i.f0)({pluginsInstallationErrors:(e,o)=>o.payload.errors}),{type:"recordFailedPluginInstallations"}]},PLUGINS_INSTALLATION_COMPLETED:{target:"postPluginInstallation",actions:[{type:"recordSuccessfulPluginInstallation"}]}},entry:l.choose([{cond:"hasJetpackSelected",actions:[(0,i.f0)({loader:{progress:10,useStages:"plugins"}}),"preFetchIsJetpackConnected","preFetchJetpackAuthUrl"]},{actions:[(0,i.f0)({loader:{progress:10,useStages:"plugins"}})]}]),invoke:{src:te,data:e=>({selectedPlugins:e.pluginsSelected,pluginsAvailable:e.pluginsAvailable})},meta:{component:V}}}},settingUpStore:{}}}),Ce=e=>{let{actionOverrides:o,servicesOverrides:t}=e;const i=(0,n.useMemo)((()=>fe.withConfig({actions:{...Le,...o},services:{...xe,...t},guards:{hasStepInUrl:(e,o,t)=>{let{cond:n}=t;const{step:i}=(0,u.getQuery)();return i===n.step},hasJetpackSelected:e=>void 0!==e.pluginsSelected.find((e=>"jetpack"===e))||void 0!==e.pluginsAvailable.find((e=>"jetpack"===e.key&&e.is_activated))}})),[o,t]),[r,a,l]=(0,s.e)(i,{devTools:!1}),M=(0,c.v)(l,(e=>{var o;return(0,m.r)(null!==(o=null==e?void 0:e.meta)&&void 0!==o?o:void 0)})),g=null==M?void 0:M.progress,[N,p]=(0,n.useState)(null);(0,n.useEffect)((()=>{null!=M&&M.component&&p((()=>null==M?void 0:M.component))}),[N,null==M?void 0:M.component]);const I=r.value instanceof Object?Object.keys(r.value)[0]:r.value;return(0,ee.p0)(["woocommerce-profile-wizard__body"]),(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:`woocommerce-profile-wizard__container woocommerce-profile-wizard__step-${I}`},N?(0,n.createElement)(N,{navigationProgress:g,sendEvent:a,context:r.context}):(0,n.createElement)(ne,null)))},he=Ce},1718:(e,o,t)=>{function n(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set;if(!o.has(e)){o.add(e);for(const t in e)if(e.hasOwnProperty(t)){if("component"===t)return e;if("object"==typeof e[t]&&null!==e[t]){const i=n(e[t],o);if(void 0!==i)return i}}}}t.d(o,{r:()=>n})},62621:e=>{e.exports=""},24122:e=>{e.exports=""},60784:(e,o,t)=>{e.exports=t.p+"67a480dd787ddfb504af.svg"},38811:e=>{e.exports=""},77:(e,o,t)=>{e.exports=t.p+"bfec8d1574ef61285fc9.svg"}}]);